#!/bin/bash

set -x

IMAGE_NAME="centos"
IMAGE_TAG="7"

for i in $(seq 1 $2); do
    echo "number ${i}"
    echo
    sleep 1

    #docker rmi "${IMAGE_NAME}":"${IMAGE_TAG}"
    timeout -s 9 180s docker rmi "$1"
    echo
    sleep 2

    #docker pull "${IMAGE_NAME}":"${IMAGE_TAG}"
    timeout -s 9 180s docker pull "$1"
    echo
    sleep 5
done
